import request from '@/utils/request'

// 获取部门列表
export function getDeptsList() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

// 根据ID删除部门
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

// 新增部门
export function addDepartments(data) {
  return request({
    url: `/company/department`,
    method: 'POST',
    data
  })
}

// 获取员工简单列表
export function getSimpleEmployeeList(data) {
  return request({
    url: `/sys/user/simple`,
    method: 'get',
    data
  })
}

// 根据ID查询部门详情
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

// 根据ID修改部门详情
export function editDepartDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

